<template>
	<view class="clearfix">
		<view scroll-x class="top">
			<view class="tab">
				<view class="tab_nav" ></view>
			</view>
		</view>
		<view class="content">
			  <view @click="lrInfo"  class="tool-item flex-space">
			    <view class="flex-align">
			      <image src="../../../static/image/page/xinxi.png" class="tool-icon"></image>
			      <view class="tool-info">
			        <text class="title">信息录入</text>
			        <text class="mark">产权人、房屋、借款等信息</text>
			      </view>
			    </view>
			    <image src="../../../static/image/page/tean-arrow-icon.png" class="arrow-icon"></image>
			  </view>
			
			  <view @click="lrImg" class="tool-item flex-space">
			    <view class="flex-align">
			      <image src="../../../static/image/page/tupian.png" class="tool-icon"></image>
			      <view class="tool-info">
			        <text class="title">图片上传</text>
			        <text class="mark">证件照、房屋照等附件上传</text>
			      </view>
			    </view>
			    <image src="../../../static/image/page/tean-arrow-icon.png" class="arrow-icon"></image>
			  </view>
			   <!-- 按钮 -->
			   <view class="btn" @click="submit">提交</view>
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
			};
		},
		onLoad(option) {
			this.id=option.id;
		},
		
		onShow() {
		
		},
	
		methods: {
			 //提交
			  submit() {
			    this.$api.getIsUploadData({
			      sid: this.id
			    }).then(res => {
			      let data = res.data;
			      if (data.data == 1) {
			        uni.showToast({
			          icon: 'none',
			          title: data.message,
			        })
			      } else {
			        uni.showModal({
			          title: '提示',
			          content: data.message,
			          success:(rt)=> {
			            if (rt.confirm) {
			              this.$api.surveyDataSubmit(
			                this.id
			              ).then(() => {
			                uni.navigateBack({
			                  delta: 2,
			                })
			              })
			            }
			          }
			        })
			      }
			
			    })
			  },
			 // 录入图片
			  lrImg() {
			    uni.navigateTo({
			      url: `/pages/survey/child/attachment?id=${this.id}`,
			    })
			  },
			  // 录入信息
			  lrInfo() {
			    uni.navigateTo({
			      url: `/pages/survey/child/in-survey?id=${this.id}`,
			    })
			  },

			
		}
	}
</script>
<style>
	page {
		background-color: #F8F8F8;
	}
</style>
<style lang="scss">
	.top {
		width: 100%;
		white-space: nowrap;
		position: fixed;
		top: var(--window-top);
		z-index: 99;
		left: 0;
		background: $dtg-color-primary;
		.tab {
			display: flex;
			flex-direction: column;
			border-radius: 20rpx 20rpx 0 0;
			background: #F8F8F8;
		}

		.tab_nav {
			height: 80rpx;
			display: flex;
			line-height: 79rpx;
			position: relative;
			font-size: 28rpx;
			justify-content: space-between;
			padding: 0 150rpx;
		}

	}
	.content{
		position: relative;
		z-index: 99;
		padding: 20px 15px;
	}
.tool-item {
  width: 100%;
  height: 160rpx;
  background: #FFFFFF;
  box-shadow: 0rpx 0rpx 38rpx 2rpx rgba(0, 0, 0, 0.04);
  border-radius: 10rpx;
  padding: 0 30rpx;
  margin-bottom: 20rpx;
}

.number {
  padding: 0 8rpx;
  height: 32rpx;
  background: #FC4073;
  border-radius: 16rpx 16rpx 16rpx 0rpx;
  margin-left: 10rpx;
  font-size: 22rpx;
  color: #FFFFFF;
}

.arrow-icon {
  width: 12rpx;
  height: 20rpx;
}

.tool-icon {
  width: 80rpx;
  height: 80rpx;
  margin-right: 28rpx;
}

.tool-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 80rpx;
}

.title {
  font-size: 32rpx;
  font-weight: bold;
  color: #333333;
}

.mark {
  font-size: 24rpx;
  color: #999999;
}
.btn {
  /* width: 100%; */
  height: 98rpx;
  background: #585CF7;
  border-radius: 45rpx;
  font-size: 36rpx;
  color: #FFFFFF;
  text-align: center;
  line-height: 98rpx;
  position: fixed;
  bottom: 30rpx;
  left: 30rpx;
  right: 30rpx;
}
	
</style>
